#include <iostream>
using namespace std;

class A
{
public:
    void funcA()
    {
        cout<< "hello world" << endl;
    }
    int m_num;
};

#if 0
class B
{
public:
    A a;//类的组合 缺点占用更多的内存 优点是设计模式安全
    void func()
    {
        a.func();
    }
};
#endif
class B : public A
{
public:
    void func()
    {
        funcA();
    }
    int count;
};

int main()
{
#if 0
    A a;
    B b;
    b.func();

    b.m_num = 10;
    b.funcA();

    cout<< b.m_num <<endl;
    cout << a.m_num << endl;
    cout << sizeof(b) << endl;
#endif


    
    return 0;
}

